/*
 * Copyright (C) 2011 Olivier Pothin and contributors
 *
 * GNU General Public License v2.0
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

/**
 * 
 * @author Olivier Pothin
 *
 */
package opot.dto;

import opot.db.WordProvider;
import android.net.Uri;
import android.provider.BaseColumns;

public class Word  {
	
	public String zh;
	public String pin;
	public String fr;
	
	public Word(){}
	
	public Word(String zh,String pin, String fr){
		
		this.zh = zh;
		this.pin = pin;
		this.fr = fr;
	}

	public static final class Words implements BaseColumns {

		private Words(){}
		
		/**
		 * The table name offered by this provider
		 */
		public static final String TABLE_NAME = "words";

		/*
		 * URI definitions
		 */

		/**
		 * The scheme part for this provider's URI
		 */
		private static final String SCHEME = "content://";

		/**
		 * Path part for the Word URI
		 */
		private static final String PATH_WORDS = "/words";

		/**
		 * Path part for the Word ID URI
		 */
		private static final String PATH_WORDS_ID = "/words/";
		
		/**
		 * Path part for the french word uri
		 */
		private static final String PATH_WORDS_FR = "/words/fr/";
		
		/**
         * 0-relative position of a word ID segment in the path part of a word ID URI
         */
        public static final int PATH_WORDS_ID_POSITION = 1;
        
        public static final int PATH_WORDS_FRENCH_POSITION = 2;
		

		public static final Uri CONTENT_URI =  Uri.parse(SCHEME + WordProvider.AUTHORITY + PATH_WORDS);
		
		public static final Uri CONTENT_ID_URI_BASE
         = Uri.parse(SCHEME + WordProvider.AUTHORITY + PATH_WORDS_ID + "#");
		
		//public static final Uri CONTENT_FR_BASE = Uri.parse(SCHEME + AUTHORITY + PATH_WORDS_FR + "#");
		
		/*
		 * Column definitions
		 */

		/**
		 * Column name for the french value
		 * <P>Type: TEXT</P>
		 */
		public static final String COLUMN_NAME_FRENCH = "fr_words";

		/**
		 * Column name of the pinyin content
		 * <P>Type: TEXT</P>
		 */
		public static final String COLUMN_NAME_PINYIN = "pin_words";

		/**
		 * Column name of the chinese content
		 * <P>Type: TEXT</P>
		 */
		public static final String COLUMN_NAME_CHINESE = "zh_words";

		/**
		 * Column name for the creation timestamp
		 * <P>Type: INTEGER (long from System.curentTimeMillis())</P>
		 */
		public static final String COLUMN_NAME_CREATE_DATE = "created";

		/**
		 * Column name for the modification timestamp
		 * <P>Type: INTEGER (long from System.curentTimeMillis())</P>
		 */
		public static final String COLUMN_NAME_MODIFICATION_DATE = "modified";
	}
}
